package br.inf.solutions.apresentacoes.ssp.control.validator;

import java.util.Map;

import br.com.vexillum.util.Return;
import br.inf.solutions.apresentacoes.ssp.model.bulletin.Bulletin;

public class BulletinPublishedItensValidator extends BaseValidator {

	public BulletinPublishedItensValidator(Map<String, Object> mapData) {
		super(mapData);
	}

	public Return validateSearchPublicatedItens() {
		Return ret = new Return(true);
		
		Bulletin bulletin = (Bulletin) mapData.get("bulletin");
		if(bulletin.getBulletinType() == null){
			ret.concat(creatReturn("bulletinType", getValidationMessage("bulletintype", "searchpublicateditens", false)));
		} 
		if(bulletin.getNumberBulletin() == null) {
			ret.concat(creatReturn("numberBulletin", getValidationMessage("numberbulletin", "searchpublicateditens", false)));
		} 
		if(bulletin.getYearBulletin() == null){
			ret.concat(creatReturn("yearBulletin", getValidationMessage("yearbulletin", "searchpublicateditens", false)));
		}
		return ret;
	}
	
}
